<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('周报统计详情')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-weekly-edit" th:object="${adminWeekly}">
            <div class="form-group">
                <label class="col-sm-3 control-label">周报起始日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="weeklyDateStart"  th:value="${#dates.format(adminWeekly.weeklyDateStart, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled="disabled">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">周报结束日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="weeklyDateEnd" th:value="${#dates.format(adminWeekly.weeklyDateEnd, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled="disabled">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div id="taskContent">
                <div class="ibox float-e-margins" >
                    <div class="ibox-title">
                        <h5>工作任务</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">产品/项目：</label>
                            <div class="col-sm-8">
                                <select th:name="productType" class="form-control" disabled="disabled">
                                    <option value="">请选择</option>
                                    <option value="0" th:selected="${adminWeekly.productType==0}">产品</option>
                                    <option value="1" th:selected="${adminWeekly.productType==1}">项目</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">产品/项目名称：</label>
                            <div class="col-sm-8">
                                <select th:name="productId" class="form-control" disabled="disabled">
                                    <option value="">[[${adminWeekly.productName}]]</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">项目进度(%)：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.progress}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">计划完成需求数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.planDemandAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">实际完成需求数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.actualDemandAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">计划完成任务数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.planTaskAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">实际完成任务数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.actualTaskAmountTotal}" disabled="disabled">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">产品转测数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.toTestAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">新增缺陷数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.newBugAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">修复缺陷数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.fixBugAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">产品体验数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.productExperienceAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">产品体验通过数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.productExperiencePassAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">产品设计评审会议数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.designReviewAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">产品设计评审会议通过数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.designReviewPassAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">发现缺陷数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.detectBugAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">关闭缺陷数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.closeBugAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">配置项目产品数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.deployProductAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">文档贡献数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.documentAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">培训数量：</label>
                            <div class="col-sm-8">
                                <input class="form-control" type="text" th:value="${adminWeekly.trainingAmountTotal}" disabled="disabled">
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var num=0
        function selectProduct(sel){
            var str = sel.name;
            let index = str.indexOf(".")
            str =str .substring(0,index);
            str += ".productId";
            var url;
            var productType= sel.value;
            url = "/system/product/"+ productType;
            if ("" === productType) {
                $("select[name='"+str+"']").empty();
                $("select[name='"+str+"']").append
                ('<option value="">请选择产品/项目</option>');
                $("select[name='"+str+"']").selectpicker('refresh');
                $("select[name='"+str+"']").selectpicker('render');
                return;
            }
            $.ajax({
                cache: true,
                type: "GET",
                url: url,
                async: false,
                success: function(result) {
                    data = result.data
                    if (result.code == web_status.SUCCESS) {
                        $("select[name='"+str+"']").empty();
                        for(var i in data){
                            // json = eval("("+data[i]+")");
                            var productId = data[i].productId;
                            var productName =data[i].productName;
                            $("select[name='"+str+"']").append
                            ('<option value="'+productId+'">'+productName+'</option>');
                        };
                        $("select[name='"+str+"']").selectpicker('refresh');
                        $("select[name='"+str+"']").selectpicker('render');
                    } else {
                        $.modal.alertError(result.msg);
                    }
                }
            });
        };
        var prefix = ctx + "system/weekly";
        $("#form-weekly-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-weekly-edit').serialize());
            }
        }

        $("input[name='weeklyDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='modifyTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>